package com.beverage.lemonade;

import org.json.JSONException;

import com.beverage.lemonade.UI.BaseActivity;
import com.beverage.lemonade.process.Constants;
import com.beverage.lemonade.process.CreateTask;
import com.beverage.lemonade.process.LogInTask;
import com.beverage.lemonade.process.SignInTask;
import com.beverage.lemonade.process.UserInfoJson;

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.view.Menu;
import android.widget.Button;

public class ShareActivity extends BaseActivity {

	private Context context;
	private static CreateTask createTask;

	private static SignInTask signInTask;

	private static LogInTask logInTask;

	public ShareActivity() {
		super(R.string.title_activity_basic_info);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		context = this;
		setContentView(R.layout.activity_basic_info);

		// createTask = new CreateTask(this);
		// SharedPreferences sp = PreferenceManager
		// .getDefaultSharedPreferences(this);
		// long time = System.currentTimeMillis();
		//
		// sp.edit().putString(Constants.USERNAME,
		// String.valueOf(time)).commit();
		// sp.edit().putString(Constants.PASSWORD,
		// String.valueOf(time)).commit();
		//
		// try {
		// UserInfoJson userJson = new UserInfoJson(context);
		// createTask.execute(userJson);
		//
		// } catch (JSONException e) {
		// // TODO Auto-generated catch block
		// e.printStackTrace();
		// }

		logInTask = new LogInTask(this);

		// long time = System.currentTimeMillis();

		try {
			UserInfoJson userJson = new UserInfoJson(context);
			userJson.setPassword("SUPER");
			userJson.setUsername("SUPER");

			logInTask.execute(userJson);

		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
